package com.nobrain.uboard.fragment;

import java.util.ArrayList;

import com.nobrain.uboard.act.R;
import com.nobrain.uboard.observer.IObserver;
import com.nobrain.uboard.observer.ObserverManager;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Timeline extends Fragment implements IObserver{
	private ListView lv;
	private ArrayAdapter<String> adapter;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.mainact_timeline, null);
		lv = (ListView) v.findViewById(R.id.lv_main_timeline);
		return v;
	}



	@Override
	public void onStart() {
		super.onStart();
		ArrayList<String> list = new ArrayList<String>();
		
		adapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1,list);
		lv.setAdapter(adapter);
	}



	@Override
	public void update(int type) {
		if(type == ObserverManager.TYPE_MAIN_SERVICES){
			adapter.notifyDataSetChanged();
		}
	}
}
